package com.example.blogdesign.Controller;

import com.example.blogdesign.Entity.UserInfo;
import com.example.blogdesign.Service.IUserInfoService;
import com.example.blogdesign.dto.Result;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@RestController
@RequestMapping("/userinfo")
public class UserInfoController {


    @Resource
    private IUserInfoService userInfoService;
    /*
     *
     * 查询用户详情
     * */
    @GetMapping("/{id}")
    public Result<UserInfo> info(@PathVariable("id") Long userId){
        return userInfoService.queryById(userId);
    }


    /*
    * 编辑用户详情
    *
    * */
    @PutMapping("/edit")
    public Result<?> editUserInfo(@RequestBody UserInfo userInfo){
        return userInfoService.editUserInfo(userInfo);
    }
}
